<?php 
/*
 * 品牌入驻申请入口
*/
class Controller_Admin_Brand extends Controller_Template
{
	public function __construct ($req, $res)
	{
		$this->template = 'smarty:shop/brandapply/index';
		parent::__construct ($req, $res);
		$this->_brand = new Category_Brand();
	}

	public function action_index()
	{
		return NULL;
	}

	/*
	 * 通过系统分类获取品牌列表
	 */
	public function action_get_brand($cate_id,$level)
	{
		if (!empty($cate_id) && !empty($level))
		$data = Category_Brand::get_by_category_level($cate_id,$level);

		$brands= array();
		if(isset($data))
		{
		foreach ($data as $r)
		{
			$brands[] = array(
			'id' => $r['brand_id'],
			'name' => $r['name'],
			'logo_url' => $r['logo_url'],
			);
				}
		}
		echo  json_encode($brands);
		exit;
	}
}
